<template>
	<view class="news">
    <jie-tu></jie-tu>
		<view class="new" v-if='item.goods_big_logo' v-for="item in news" @click="navagator(item)">
			<image :src="item.goods_big_logo"></image>
			<view class="info">
				<view class="tit">{{item.goods_name}}</view>
				<view class="txt">
					<text>时间:20121231</text>
					<text>浏览量:2000</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				news:[] 
			}
		},
		onLoad() {
			this.getNews()
		},
		methods: {
			async getNews(){
				const res = await this.http({
					url:'/api/public/v1/goods/search'
				})
				this.news = res.data.message.goods
				console.log(this.news)
			},
			navagator(item){
				uni.navigateTo({
					url:'../newDetail/newDetail?goods_id='+item.goods_id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.news{
	.new{
		display: flex;
		padding: 10rpx 20rpx;
		border-bottom: 1px solid $shop-color;
		image{
			min-width: 200rpx;
			max-width: 200rpx;
			height: 170rpx;
		}
		.info{
			margin-left: 15rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.tit{
				font-size: 33rpx;
			}
			.txt{
				display: flex;
				justify-content: space-between;
			}
		}
		
	}
}
</style>
